package handlers

import (
	"earth/models"

	"github.com/gin-gonic/gin"
)

type BaseHandler struct {
}

func (b *BaseHandler) getStringParam(c *gin.Context, name string) (string, error) {
	return c.Params.ByName(name), nil
}

func (b *BaseHandler) getCurrentUser(c *gin.Context) models.User {
	return c.MustGet("user").(models.User)
}
